import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:get/get.dart';
import 'package:get/get_state_manager/src/simple/get_controllers.dart';

class LocationDisplayWidget extends StatelessWidget {
  final String locationName;
  final String cityName;
  Function() onClose;

  LocationDisplayWidget(
      {required this.locationName,
      required this.cityName,
      required this.onClose});

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Padding(
      padding: const EdgeInsets.fromLTRB(10, 20, 10, 5),
      child: SizedBox(
        height: 100,
        child: Container(
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.circular(10),
          ),
          child: Padding(
            padding: const EdgeInsets.fromLTRB(20, 0, 0, 0),
            child: Row(
              children: [
                Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text(
                      locationName,
                      style: const TextStyle(
                          fontSize: 20,
                          fontWeight: FontWeight.bold,
                          color: Colors.blue),
                    ),
                    Text(
                      cityName,
                      style:
                          const TextStyle(fontSize: 15, color: Colors.blueGrey),
                    )
                  ],
                ),
                const Spacer(),
                IconButton(
                    onPressed: () {
                      this.onClose();
                    },
                    icon: const Icon(
                      Icons.close,
                      color: Colors.black12,
                    )),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
